<?php

namespace App\Models\CarModels;

use App\Models\SystemManagement\Employee;
use Illuminate\Database\Eloquent\Model;

class CarPunishRecord extends Model
{

    protected $table = 'car_punish_records';
    protected $fillable = ['amount','record_time','address','behavior','detail','desc','car_id','staff_id','record_id'];
    public function cars(){
        return $this->belongsTo(CarInfo::class,'car_id','id')->with('kind');
    }
    public function car(){
        return $this->belongsTo(CarInfo::class,'car_id','id')->with('kind');
    }

    public function staff(){
        return $this->belongsTo(Employee::class,'staff_id','id');
    }

    public function record(){
        return $this->belongsTo(Employee::class,'record_id','id');
    }

    public function files()
    {
        return $this->hasMany(CarPunishRecordFile::class,'f_id')->with('file');
    }
}
